import React, { Component } from 'react'




import Son1 from './Son1'
import Son2 from './Son2'
import Son3 from './Son3'

export default class Parent extends Component {

    state = {
        num: 1
    }


    changeNum = (payload) => {
        this.setState({
            num: this.state.num + payload
        })
    }
    render () {
        return (
            <div>Parent

                <Son1 num={this.state.num}></Son1>

                <Son2 change={this.changeNum} ></Son2>

                <Son3></Son3>
            </div>
        )
    }
}
